package com.google.code.jcooky.chat.commons.jrc;

public enum PacketType {
	ENTER_USER(0),	MESSAGE(1),	SYSTEM_INFO(2),	CLOSED_USER(3);

	private final int value;

	private PacketType(int value) {
		this.value = value;
	}

	public int getValue() {
		return value;
	}

	public static PacketType valueOf(int value) {
		switch (value) {
		case 0:
			return ENTER_USER;
		case 1:
			return MESSAGE;
		case 2:
			return SYSTEM_INFO;
		case 3:
			return CLOSED_USER;

		default:
			return null;
		}
	}
}
